package registration.adventurezone.thevine.com;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class AZregActivity extends Activity {
	
	private Button addButton;
	private Button inButton;
	private Button outButton;
	private Button databaseButton;
	private Button statsButton;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        this.findAllViewsById(); //find buttons by id from xml
        //set onClick callback for all buttons
        addButton.setOnClickListener(new OnClickListener() {           
        	public void onClick(View v) {
        		Intent myIntent = new Intent(AZregActivity.this, AddChildActivity.class);
        		AZregActivity.this.startActivity(myIntent);
        	}
		});
        inButton.setOnClickListener(new OnClickListener() {           
        	public void onClick(View v) {
        		Intent myIntent = new Intent(AZregActivity.this, CheckInActivity.class);
        		AZregActivity.this.startActivity(myIntent);
        	}
		});
        outButton.setOnClickListener(new OnClickListener() {           
        	public void onClick(View v) {
        		Intent myIntent = new Intent(AZregActivity.this, CheckOutActivity.class);
        		AZregActivity.this.startActivity(myIntent);
        	}
		});
        databaseButton.setOnClickListener(new OnClickListener() {           
        	public void onClick(View v) {
        		Intent myIntent = new Intent(getBaseContext(), DatabaseActivity.class);
        		AZregActivity.this.startActivity(myIntent);
        	}
		});
        statsButton.setOnClickListener(new OnClickListener() {           
        	public void onClick(View v) {
        		Intent myIntent = new Intent(AZregActivity.this, StatsActivity.class);
        		AZregActivity.this.startActivity(myIntent);
        	}
		});
    }
    
    private void findAllViewsById() {
    	addButton = (Button) findViewById(R.id.addButton);
    	inButton = (Button) findViewById(R.id.inButton);
    	outButton = (Button) findViewById(R.id.outButton);
    	databaseButton = (Button) findViewById(R.id.databaseButton);
    	statsButton = (Button) findViewById(R.id.statsButton);
    	 
    }
}